<template>
    <div class="setting">
        <a-form ref="formRef" auto-label-width :model="form" @submit="handleSubmit">
            <a-form-item field="commission" label="手续费" label-col-flex="auto" :label-col-style="{ width: '85px' }">
                <a-input v-model="form.commission" placeholder="请输入手续费"></a-input>
            </a-form-item>
            <a-form-item field="min" label="最小数量" label-col-flex="auto" :label-col-style="{ width: '85px' }">
                <a-input v-model="form.min" placeholder="请输入最小提现数量"></a-input>
            </a-form-item>
            <a-form-item field="content" label="说明" label-col-flex="auto" :label-col-style="{ width: '85px' }">
                <ma-editor v-model="form.content" :height="600" />
            </a-form-item>
            <a-form-item>
                <a-button type="primary" style="margin-right:20px;" html-type="submit">立即提交</a-button>
                <a-button type="outline" @click="$refs.formRef.resetFields()">重置</a-button>
            </a-form-item>
        </a-form>
    </div>
</template>
<script setup>
import request from "@/api/base/setting";
import { Message } from "@arco-design/web-vue";
import { ref } from "vue";
const form = ref({
    key: "withdrawal",
    commission: "",
    min: "",
    content: ""
});

const get_list = async () => {
    let { data } = await request.get_deta({
        key: form.value.key
    });
    form.value = data;
};
get_list();

const handleSubmit = async () => {
    await request.save(form.value);
    Message.success("保存成功");
};
</script>
<style lang="scss" scoped>
.setting {
    padding: 20px;
    box-sizing: border-box;
    background-color: #fff;
}
</style>